home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
swtools
/
trubasic
/
rolldemos
/
chooser
/
ipmenu.tru
< prev
next >
Wrap
Text File
|
1994-08-02
|
2KB
|
66 lines
external
! main menu loop for ip demos
module ip
DECLARE PUBLIC ippts(,),iptxt$()
sub ip_demos
call draw_ip
call waitup
do
call getclick_ip(op)
if op=1 then
chain "!cd ../demos/ip;../../basic/gltru -i alternate.tru &",return
elseif op=2 then
chain "!cd ../demos/ip;../../basic/gltru -i flip.tru &",return
elseif op=3 then
chain "!cd ../demos/ip;../../basic/gltru -i aboutip.tru &",return
elseif op=4 then
chain "!cd ../demos/ip;../../basic/gltru -i shift_brownian.tru &",return
elseif op=0 then
exit sub
end if
if op<>0 and op<>-1 then
call expand(ippts(op,1),ippts(op,2),ippts(op,3),ippts(op,4))
draw textbox(ippts(op,1),ippts(op,2),ippts(op,3),ippts(op,4),iptxt$(op))
call waitup
pause 3
call unexpand(ippts(op,1),ippts(op,2),ippts(op,3),ippts(op,4))
draw textbox(ippts(op,1),ippts(op,2),ippts(op,3),ippts(op,4),iptxt$(op))
end if
if refresh(1)=1 then
call draw_ip
end if
loop
end sub
sub draw_ip
let u=ubound(ippts,1)
clear
for i=1 to u
draw ipbox(i)
next i
box keep 0,1,0,1 in ipbox$
end sub
picture ipbox(op)
draw box(ippts(op,1),ippts(op,2),ippts(op,3),ippts(op,4),op)
draw textbox(ippts(op,1),ippts(op,2),ippts(op,3),ippts(op,4),iptxt$(op))
end picture
sub getclick_ip(op)
get mouse x,y,state
let op=-1
if state<>0 and x>=0 and x<=1 and y>=0 and y<=1 then
let u=ubound(ippts,1)
let op=0
for i=1 to u
if x>ippts(i,1) and x<ippts(i,2) and y>ippts(i,3) and y<ippts(i,4) then
let op=i
exit sub
end if
next i
end if
end sub
end module